using System;
using System.Collections.Generic;

public static class RangeSelectors
{
    public static bool WarriorRangeSelector(int layer, int number, bool campIsSelf, GridNode gridNode)
    {
        if (campIsSelf)
        {
            if (layer >= gridNode.layer
                 && RoadManager.roads[
                    GridManager.GetGridNum(gridNode.layer, gridNode.number),
                    GridManager.GetGridNum(layer, number)])
            {
                return true;
            }
        }
        else
        {
            if (layer <= gridNode.layer
                 && RoadManager.roads[
                    GridManager.GetGridNum(gridNode.layer, gridNode.number),
                    GridManager.GetGridNum(layer, number)])
            {
                return true;
            }
        }
        return false;
    }

    public static bool ArcherRangeSelector(int layer, int number, bool campIsSelf, GridNode gridNode)
    {
        int range = gridNode.Pawn.Property.Range;
        if (campIsSelf)
        {
            if (layer >= gridNode.layer && layer <= gridNode.layer + range)
            {
                return true;
            }
        }
        else
        {
            if (layer <= gridNode.layer && layer >= gridNode.layer - range)
            {
                return true;
            }
        }
        return false;
    }
}
